<html>
<head><meta charset="utf-8"><title>Pretty-printing THIR · t-compiler/wg-rustc-dev-guide · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/196385-t-compiler/wg-rustc-dev-guide/index.html">t-compiler/wg-rustc-dev-guide</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/196385-t-compiler/wg-rustc-dev-guide/topic/Pretty-printing.20THIR.html">Pretty-printing THIR</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="230040822"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/196385-t-compiler/wg-rustc-dev-guide/topic/Pretty-printing%20THIR/near/230040822" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/196385-t-compiler/wg-rustc-dev-guide/topic/Pretty-printing.20THIR.html#230040822">(Mar 12 2021 at 14:50)</a>:</h4>
<p><code>-Zunpretty=thir-tree</code> landed on master today, so I was wondering if a full THIR pretty-printer (akin to the HIR pretty-printer) would be interesting also</p>



<a name="230042429"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/196385-t-compiler/wg-rustc-dev-guide/topic/Pretty-printing%20THIR/near/230042429" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/196385-t-compiler/wg-rustc-dev-guide/topic/Pretty-printing.20THIR.html#230042429">(Mar 12 2021 at 15:00)</a>:</h4>
<p>To clarify, what I mean by "a full pretty-printer" is something that would output Rust-looking code but with all the THIR desugaring</p>



<a name="230069205"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/196385-t-compiler/wg-rustc-dev-guide/topic/Pretty-printing%20THIR/near/230069205" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/196385-t-compiler/wg-rustc-dev-guide/topic/Pretty-printing.20THIR.html#230069205">(Mar 12 2021 at 17:39)</a>:</h4>
<p>I feel like it would be interesting yeah</p>



<a name="230184673"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/196385-t-compiler/wg-rustc-dev-guide/topic/Pretty-printing%20THIR/near/230184673" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/196385-t-compiler/wg-rustc-dev-guide/topic/Pretty-printing.20THIR.html#230184673">(Mar 13 2021 at 19:47)</a>:</h4>
<p>What does the <code>thir-tree</code> output look like?</p>



<a name="230231689"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/196385-t-compiler/wg-rustc-dev-guide/topic/Pretty-printing%20THIR/near/230231689" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/196385-t-compiler/wg-rustc-dev-guide/topic/Pretty-printing.20THIR.html#230231689">(Mar 14 2021 at 11:16)</a>:</h4>
<p><span class="user-mention" data-user-id="307537">@Camelid</span> I left an example output in the PR (<a href="https://github.com/rust-lang/rust/issues/82860">#82860</a>)</p>



<a name="230231782"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/196385-t-compiler/wg-rustc-dev-guide/topic/Pretty-printing%20THIR/near/230231782" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/196385-t-compiler/wg-rustc-dev-guide/topic/Pretty-printing.20THIR.html#230231782">(Mar 14 2021 at 11:18)</a>:</h4>
<p>It's basically the <code>Debug</code> output of the THIR data structures, like <code>-Zunpretty=hir-tree</code> does</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>